package start;

import java.awt.Font;
import java.util.Enumeration;

import javax.swing.UIManager;
import javax.swing.plaf.FontUIResource;

import ui.MainFrame;

public class Run {
	public static void main(String[] args) {
		try {
			org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
			UIManager.put("RootPane.setupButtonVisible", false);
		} catch (Exception e) {
			e.printStackTrace();
		}
		InitGlobalFont(new Font("微软雅黑", Font.BOLD, 14));
		new MainFrame().setVisible(true);
	}

	// 强制设置字体
	private static void InitGlobalFont(Font font) {
		FontUIResource fontRes = new FontUIResource(font);
		UIManager.put("OptionPane.buttonFont", new FontUIResource(font));
		UIManager.put("OptionPane.messageFont", new FontUIResource(font));
		for (Enumeration<Object> keys = UIManager.getDefaults().keys(); keys.hasMoreElements();) {
			Object key = keys.nextElement();
			Object value = UIManager.get(key);
			if (value instanceof FontUIResource) {
				UIManager.put(key, fontRes);
			} 
		}
	}
}